package com.netty.common.entity;

import cn.hutool.core.date.DateTime;
import cn.hutool.core.util.PageUtil;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.netty.common.entity.base.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * @author LiuXiaoYu
 * @date 2022/2/1- 11:16
 */
@AllArgsConstructor
@NoArgsConstructor
@Getter
@Setter
@Accessors(chain = true)
public class Message extends BaseEntity implements Serializable {
    private static final long serialVersionUID = 478123456;

    @TableId(type = IdType.AUTO)
    private Integer id;
    // 发送方id
    private Integer fromId;

    // 接收方id
    private Integer toId;

    // 消息内容
    private String infoContent;

    // 消息类型 在线或离线
    private Boolean online;

    // 消息状态 群聊或私聊 1为私聊 0为群聊
    private Boolean singleMessage;

    //发送时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date sendTime;

}
